package com.njwb.day06.aaa;

public class Main {
    public static void main(String[] args) {
/*        Cxy Node=new Cxy();
        Node.name="张三";
        Node.age=35;
        Node.work();
        System.out.println("================");
        Hr b=new Hr();
        b.work();
        */
        Work aa=new Cxy();
        aa.name="张三";
        aa.age=35;
        Boss(aa);
        Work bb=new Hr();
        bb.name="李四";
        bb.age=40;
        Boss(bb);



    }
    public static void Boss(Work cc){
        if (cc instanceof Cxy){
            System.out.print("老板让");
            Cxy c=(Cxy)cc;
            c.work();

        }
        else if (cc instanceof Hr){
            System.out.print("老板让");
            Hr d=(Hr)cc;
            d.work();
        }
    }
}
